package com.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dao.TempfileDao;
import com.model.Astuff;
import com.model.Tempfile;
import com.service.TempfileManager;

@Component("tempfileManager")
public class TempfileManagerImpl implements TempfileManager {
	private TempfileDao tempfileDao;

	public TempfileDao getTempfileDao() {
		return tempfileDao;
	}

	@Resource
	public void setTempfileDao(TempfileDao tempfileDao) {
		this.tempfileDao = tempfileDao;
	}

	public Tempfile getTempfileById(int fileid) {
		return tempfileDao.getTempfileById(fileid);
	}

	public List<Tempfile> getTempfileListByUser(Astuff astuff, int offset,
			int length) {
		return tempfileDao.getTempfileListByUser(astuff, offset, length);
	}

	public Long getTempfileCountByUser(Astuff astuff) {
		return tempfileDao.getTempfileCountByUser(astuff);
	}
	
	public List<Tempfile> getUnReadTempfileListByUser(Astuff astuff, int offset,
			int length) {
		return tempfileDao.getUnReadTempfileListByUser(astuff, offset, length);
	}
	
	public Long getUnReadTempfileCountByUser(Astuff astuff) {
		return tempfileDao.getUnReadTempfileCountByUser(astuff);
	}

	public void setTempfileReaded(Astuff astuff, int fileid) {
		tempfileDao.setTempfileReaded(astuff, fileid);
	}

}
